<template>
    <div>
        年龄<input type="text" v-model="age" id="">
        <button @click="sendBrotherData">向我的兄弟传递数据</button>
        <button @click="sendParentData">向父组件传递数据</button>
    </div>
</template>

<script>
export default {
    name:'inp',
    data() {
        return {
            age:20
        };
    },
    methods:{
        sendBrotherData(){
            this.$EventBus.$emit('hello','嘎嘎嘎嘎')
        },
        sendParentData(){
            this.$emit('sendParent','哈哈哈哈')
        }
        
    }
};
</script>

<style scoped lang="scss">

</style>
